# HSIFoodIngr-64: a dataset for hyperspectral food-related studies

## Description

This is a new food image dataset HSIFoodIngr-64 containing 3,389 pairs of HSI and RGB images with 21 dish classes and 64 ingredient categories. It is the first HSI based food mage dataset, of which all images are labeled with dish-level and ingredient-level annotations and corresponding pixel-wise ingredient masks. Therefore, our dataset can be applicable for different food-centric tasks.

## Size

This dataset has 3,389 pairs of HSI and RGB images. The total size of the dataset is over 600GB. Image files are compressed to 189 packages, with an average size of 2GB.  All label files are with .json format and they are compressed to one package.

## Details

For each image pair, it has four corresponding files(* refers to the image index):

- REFLECTANCE_*.hdr
  - Head information with the ENVI format for the HSI image data. It contains the data recorded information such as the samples, lines, bands, file type, interleave type and wavelength.

- REFLECTANCE_*.dat
  - HSI image data. 
  - Each file records a data cube with a size of 512x512x204(width x height x band). 
  - They are recorded with BIL(Band interleaved by line）type. It is a scheme for storing the actual pixel values of an image in a file band by band for each line, or row, of the image. All bands of data are written for row one, all bands of data are written for row two, and so on. 
  - The recorded data type is 4, namely floating point. 
- REFLECTANCE_*.png
  - RGB image data. 
  - It has three bands and the height and width number are both 512.
- REFLECTANCE_*.json
  - The label file for each image pair. 
  - It has all the basic information for each mask, such as the mask polygon coordinates and  the corresponding ingredient. 
  - 'label' records the dish and ingredient information, for example 'Sandwich/Lettuce' refers that the dish is Sandwich, and the polygon ingredient is Lettuce.
  - 'coordinates' records all the polygon coordinate list([coordinate x, coordinate y]).